<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>编辑标准信息</title>
<script type="text/javascript" src="script/jquery-1.10.2.js"></script>
<script type="text/javascript" src="script/jquery.validate.js"></script>
<script type="text/javascript">
	$(function(){
		$("#form").validate({
			rules:{
				"standard.stdNum":{
					required:true,
					remote:"checkNumExist"
				},
				"standard.zhname":{
					required:true,
				},
				"standard.version":{
					required:true
				},
				"standard.keys":{
					required:true
				},
				"standard.releaseDate":{
					required:true,
					date:true
				},
				"standard.implDate":{
					required:true,
					date:true
				}
			},
			messages:{
				"standard.stdNum":{
					required:"请输入标准号",
					remote:"该标准号已存在，请重新指定"
				},
				"standard.zhname":{
					required:"请输入中文名称",
				},
				"standard.version":{
					required:"请输入版本"
				},
				"standard.keys":{
					required:"请输入关键字"
				},
				"standard.releaseDate":{
					required:"请输入发布日期",
					date:"日期格式不正确"
				},
				"standard.implDate":{
					required:"请输入实施日期",
					date:"日期格式不正确"
				}
			}
		});
	});
</script>
<style type="text/css">
* {
	margin: 0px auto;
	padding: 0px;
}

#container {
	text-align: center
}

h2 {
	margin: 10px;
}

tr {
	margin: 0px;
	padding: 0px;
}

table tr td {
	border: 1px black solid;
	padding: 2px;
	text-align: left;
	width: 330px;
}

table tr td:first-child {
	text-align: right;
	width: 300px;
}

#container .sp {
	text-align: center;
}
label.error{color:red;}

input[type=text] {
	width: 200px;
	height: auto;
}
</style>
</head>
<body>
	<div id="container">
		<h2>
		<c:if test="${id >0 }">
			修改标准信息
		</c:if>
		<c:if test="${id <=0 }">
			增加标准信息
		</c:if>
		</h2>
		<form action="edit" method="post" id="form" enctype="multipart/form-data">
			<table cellpadding="0" cellspacing="0">
			<input type="hidden" value="${standard.packagePath }" name="standard.packagePath"/>
			<input type="hidden" value="${standard.id }" name="standard.id"/>
				<tr>
					<td>*标准号:</td>
					<td><input type="text" name="standard.stdNum" value="${standard.stdNum }"/></td>
				</tr>
				<tr>
					<td>*中文名称：</td>
					<td><input type="text" name="standard.zhname" value="${standard.zhname }"/></td>
				</tr>
				<tr>
					<td>*版本：</td>
					<td><input type="text" name="standard.version" value="${standard.version }"/></td>
				</tr>
				<tr>
					<td>*关键字/词：</td>
					<td><input type="text" name="standard.keys" value="${standard.keys }"/></td>
				</tr>
				<tr>
					<td>*发布日期(yyyy-MM-dd)：</td>
					<td><input type="text" name="standard.releaseDate"  value="${standard.releaseDate }"/></td>
				</tr>
				<tr>
					<td>*实施日期(yyyy-MM-dd)：</td>
					<td><input type="text" name="standard.implDate"  value="${standard.implDate }"/></td>
				</tr>
				<tr>
					<td>*附件：</td>
					<td><input type="file" name="attachement"/></td>
				</tr>
				<tr>
					<td colspan="2" class="sp"><input type="submit" value="保存" />&nbsp;&nbsp;
						<input type="button" id="cancel" value="取消" onclick="location.href='index'" /></td>
				</tr>
			</table>
		</form>
	</div>
</body>
</html>